import { start, Settings } from "./index";
import path = require("path");
import fs = require("fs");

let config: Settings = {
    db_host: "127.0.0.1",
    db_port: 3306,
    db_user: "root",
    db_password: "111111",
    target_host: '127.0.0.1',            // 目标主机，服务所在的主机
    gatewayPort: 2857,
    gatewayBindIP: "127.0.0.1",
    logLevel: null,
}

if (fs.existsSync("config.json")) {
    let outerConfig = JSON.parse(fs.readFileSync('config.json', 'utf8'));
    Object.assign(config, outerConfig);
}

start(config);